// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
/**
 * 用户菜单
 */
//用户列表
import userList from '@/views/User/userList'
//主体资格申请列表
import userApp from '@/views/User/userApp'
//用户详情页面
import userDetail from '@/views/User/userDetail'
//管理员管理用户界面
import userJob from "@/views/User/userJob"
/**
 * 活动菜单
 */
//活动列表
import activityList from '@/views/Activity/activityList'
//活动申请列表
import activityApp from '@/views/Activity/activityApp'
//活动详情页面
import activityDetail from '@/views/Activity/activityDetail'
//管理员管理活动界面
import activityJob from '@/views/Activity/activityJob'
//新建活动页面
import newActicity from '@/views/Activity/newActivity'
/**
 * Banner管理菜单
 */
//Banner列表
import bannerList from '@/views/Banner/bannerList'
//Banner详情
import bannerDetail from '@/views/Banner/bannerDetail'
/**
 * 邀请码管理
 */
import keyList from '@/views/Key/keyList'
// 启用路由
Vue.use(Router);
const originalPush = Router.prototype.push
   Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
            
        {
            path: '/User/userList',
            name: '用户列表',
            component: userList,
            meta: {
                requireAuth: true
            }
        },{
            path: '/User/userDetail',
            name: '用户详情',
            component: userDetail,
            meta: {
                requireAuth: true
            }
        },{
            path: '/User/userJob',
            name: '管理员用户工作',
            component: userJob,
            meta: {
                requireAuth: true
            }
        },{
            path: '/User/userApp',
            name: '主体资格申请列表',
            component: userApp,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Activity/activityApp',
            name: '活动申请列表',
            component: activityApp,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Activity/activityList',
            name: '活动列表',
            component: activityList,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Activity/activityDetail',
            name: '活动详情页面',
            component: activityDetail,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Activity/activityJob',
            name: '管理员活动页面',
            component: activityJob,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Activity/newActivity',
            name: '新建活动页面',
            component: newActicity,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Banner/bannerDetail',
            name: '轮播图详情',
            component: bannerDetail,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Banner/bannerList',
            name: '轮播图列表',
            component: bannerList,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Key/keyList',
            name: '邀请码列表',
            component: keyList,
            meta: {
                requireAuth: true
            }
        }, ]
    }]
})